/*
 * @Author: silence silence9685@163.com
 * @Date: 2023-04-23 10:15:22
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2023-07-04 15:28:01
 * @FilePath: \lenercom_bluetooth_app\lib\pages\Mine\Feedback\FeedbackPage.dart
 * @Description: 产品-常见问题-list
 */
import 'package:flutter/material.dart';
import '../../../utils/color/ColorUtils.dart';
import 'package:sil_base_widget_package/sil_base_widget_package.dart';

import '../../../base/SilScaffold.dart';
import '../../../utils/router/ARouter.dart';
import 'MoreFaqsPage.dart';
import 'View/HelpFaqsItemView.dart';
import 'View/HelpTitleView.dart';

class ProductFaqsPage extends StatefulWidget {
  final String productName;
  const ProductFaqsPage({required this.productName, Key? key})
      : super(key: key);

  @override
  State<ProductFaqsPage> createState() => _ProductFaqsPageState();
}

class _ProductFaqsPageState extends State<ProductFaqsPage> {
  @override
  Widget build(BuildContext context) {
    return SilScaffold(
      title: this.widget.productName,
      trailingWidget: SilButton(
        title: '查看更多',
        titleColor: ColorUtils.color_font_main,
        fontSize: 14.w,
        fontWeight: FontWeight.w400,
        padding: EdgeInsets.only(right: 20.w),
        onTapFunc: () {
          /// 常见问题
          ARoute.gotoPage(context, MoreFaqsPage());
        },
      ),
      body: mainWidget(),
    );
  }

  mainWidget() {
    return Container(
      margin: EdgeInsets.only(top: 34.w),
      child: Column(
        children: [
          /// 标题
          HelpTitleView(
            title: '常见问题',
          ),

          /// 设备列表
          Expanded(child: listView())
        ],
      ),
    );
  }

  listView() {
    return ListView.builder(
        itemBuilder: (context, index) {
          return HelpFaqsItemView();
        },
        itemCount: 5);
  }
}
